home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / TPWENG / PSWDEL.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-22  |  654b  |  35 lines

  1. program PswDel;
  2. uses PXEngine, WinCrt, WinTypes;
  3.  
  4. const TableName = 'Table';
  5.       Password  = 'Password';
  6.  
  7. var   PxErr: Integer;
  8.       Protected: Bool;
  9.  
  10. procedure PX(Code : integer);
  11. begin
  12.   writeln(PXErrMsg(Code));
  13. end;
  14.  
  15. begin
  16.   PX(PXWinInit('MyApp', pxShared));
  17.   PX(PXTblProtected(TableName, Protected));
  18.  
  19.   if Protected then
  20.     PxErr := PXPswAdd(Password);
  21.  
  22.   (* Open encrypted table and when done with table, delete password
  23.      from system, if necessary
  24.   *)
  25.   if Protected then
  26.   begin
  27.     PxErr := PXPswDel(Password);
  28.     if PxErr <> PxSuccess then
  29.       Writeln(PxErrMsg(PxErr));
  30.   end;
  31.  
  32.   PX(PXExit);
  33. end.
  34.  
  35.